package fr.toto.menuitem;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;

import com.kokotchy.betaSeriesAPI.model.Show;

import fr.toto.triseries.ExecQuery;
import fr.toto.triseries.Query;

public class ArchivedShowMenuItem extends JMenuItem {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5677130689302033735L;
	private Show show;

	public ArchivedShowMenuItem(Show s) {
		super(s.getTitle());
		show = s;

		this.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				show.setArchived(false);
				(new Thread(new ExecQuery(show, Query.UNARCHIVE))).start();
			}
		});
	}

}
